const clientSearchColumns = [
  {
    title: '客户名',
    dataIndex: 'name',
    width: '300px'
  },
  {
    title: '客户ID',
    dataIndex: 'id',
    width: '100px'
  },
  {
    title: '地址',
    dataIndex: 'address',
  },
  {
    title: '电话',
    dataIndex: 'phone',
    width: '300px'
  },
  {
    title: '操作',
    key: 'operation',
    dataIndex: 'operation',
    scopedSlots: { customRender: 'operation' },
    fixed: 'right'
  },
  
];

const orderSearchColumnsParent = [
  {
    title: '客户',
    dataIndex: 'clientId',
    width: 250
  },
  {
    title: '订单数量',
    dataIndex: 'orderQuantity',
    scopedSlots: { customRender: 'orderQuantity' },
  }
]

const orderSearchColumns = [
  // {
  //   title: '客户ID',
  //   dataIndex: 'clientId',
  //   width: 125,
  //   filters: [],
  //   onFilter: (value, record) => record.clientId.indexOf(value) === 0,
  //   sorter: (a, b) => {
  //     return a.clientId > b.clientId ? 1 : -1;
  //   },
  // },
  {
    title: '客户PO',
    dataIndex: 'po',
    scopedSlots: { customRender: 'po' },
    width: 150
  },
  {
    title: '客方货号',
    dataIndex: 'goodsNumber',
    scopedSlots: { customRender: 'goodsNumber' },
    width: 150
  },
  {
    title: '备注',
    dataIndex: 'remark',
    scopedSlots: { customRender: 'remark' },
    width: 280
  },
  {
    title: '盒式',
    dataIndex: 'goodsType',
    width: 70
  },
  {
    title: '纸质',
    dataIndex: 'quality',
    width: 75
  },
  {
    title: '规格',
    dataIndex: 'size',
    width: 150
  },
  {
    title: '数量',
    dataIndex: 'quantity',
    width: 100
  },
  {
    title: '单价',
    dataIndex: 'price',
    width: 100
  },
  {
    title: '金额',
    dataIndex: 'amount',
    width: 140
  },
  {
    title: '订单ID',
    dataIndex: 'id',
    width: 60
  },
  {
    title: '操作',
    key: 'operation',
    dataIndex: 'operation',
    fixed: 'right',
    scopedSlots: { customRender: 'operation' },
  },
  
];

const orderAppendColumns = [
  {
    title: '操作',
    key: 'operation',
    dataIndex: 'operation',
    width: 30,
    scopedSlots: { customRender: 'operation' },
  },
  {
    title: '客户PO',
    dataIndex: 'po',
    width: '150px',
    scopedSlots: { customRender: 'po' },
  },
  {
    title: '客方货号',
    dataIndex: 'goodsNumber',
    width: '120px',
    scopedSlots: { customRender: 'goodsNumber' },
  },
  {
    title: '盒式',
    dataIndex: 'goodsType',
    width: '80px',
    scopedSlots: { customRender: 'goodsType' },
  },
  {
    title: '纸质',
    dataIndex: 'quality',
    width: '70px',
    scopedSlots: { customRender: 'quality' },
  },
  {
    title: '规格',
    dataIndex: 'size',
    width: '200px',
    scopedSlots: { customRender: 'size' },
  },
  {
    title: '数量',
    dataIndex: 'quantity',
    width: '75px',
    scopedSlots: { customRender: 'quantity' },
  },
  {
    title: '单价',
    dataIndex: 'price',
    width: '75px',
    scopedSlots: { customRender: 'price' },
  },
  {
    title: '金额',
    dataIndex: 'amount',
    width: '80px',
    scopedSlots: { customRender: 'amount' },
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: '150px',
    scopedSlots: { customRender: 'remark' },
  },
];

const deliverySearchColumns = [
  {
    title: '客户ID',
    dataIndex: 'clientId',
    filters: [],
    onFilter: (value, record) => record.clientId.indexOf(value) === 0,
    sorter: (a, b) => {
      return a.clientId > b.clientId ? 1 : -1;
    },
  },
  {
    title: '订单量',
    dataIndex: 'orderQuantity',
    width: 66
  },
  {
    title: '货单总金额',
    dataIndex: 'totalAmount',
  },
  {
    title: '送货时间',
    dataIndex: 'deliveryDate',
    sorter: (a, b) => {
      return a.deliveryDate > b.deliveryDate ? 1 : -1;
    },
  },
  {
    title: '送货单号',
    dataIndex: 'deliveryNumber',
  },
  {
    title: '送货地址',
    dataIndex: 'deliveryAddress',
    width: 330
  },
  {
    title: '联系电话',
    dataIndex: 'clientPhone',
    width: 165,
  },
  {
    title: '货币',
    dataIndex: 'currency',
  },
  {
    title: '审核人',
    dataIndex: 'reviewer',
  },
  {
    title: '车牌号',
    dataIndex: 'plateNumber',
  },
  {
    title: '送货单ID',
    dataIndex: 'id',
    sorter: (a, b) => {
      return a.id > b.id ? 1 : -1;
    },
    scopedSlots: { customRender: 'id' },
    sortDirections: ['ascend'],
  },
  {
    title: '操作',
    key: 'operation',
    dataIndex: 'operation',
    width: 140,
    scopedSlots: { customRender: 'operation' },
    fixed: 'right'
  },
  
];


const deliveryAppendColumns = [
  {
    title: '客户PO',
    dataIndex: 'po',
    width: '140px',
    scopedSlots: { customRender: 'po' },
  },
  {
    title: '客方货号',
    dataIndex: 'goodsNumber',
    width: '120px',
    scopedSlots: { customRender: 'goodsNumber' },
  },
  {
    title: '盒式',
    dataIndex: 'goodsType',
    width: '70px',
    scopedSlots: { customRender: 'goodsType' },
  },
  {
    title: '纸质',
    dataIndex: 'quality',
    width: '70px',
    scopedSlots: { customRender: 'quality' },
  },
  {
    title: '规格',
    dataIndex: 'size',
    width: '120px',
    scopedSlots: { customRender: 'size' },
  },
  {
    title: '数量',
    dataIndex: 'quantity',
    width: '80px',
    scopedSlots: { customRender: 'quantity' },
  },
  {
    title: '单价',
    dataIndex: 'price',
    width: '80px',
    scopedSlots: { customRender: 'price' },
  },
  {
    title: '金额',
    dataIndex: 'amount',
    width: '100px',
    scopedSlots: { customRender: 'amount' },
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: '200px',
    scopedSlots: { customRender: 'remark' },
  },
  {
    title: '订单ID',
    dataIndex: 'id',
    width: '50px',
    scopedSlots: { customRender: 'id' },
  }
];

// const deliveryCheckColumns = Object.assign(deliveryAppendColumns);

const deliveryCheckColumns = [...deliveryAppendColumns, {
  title: '操作',
  key: 'operation',
  dataIndex: 'operation',
  width: 140,
  scopedSlots: { customRender: 'operation' },
  fixed: 'right'
}];

const summaryColumns = [
  {
    title: '送货日期',
    dataIndex: 'deliveryDate',
    width: 100
  },
  {
    title: '送货单号',
    dataIndex: 'deliveryNumber',
    width: 100
  },
  {
    title: '订单ID',
    dataIndex: 'orderId',
    width: 80
  },
  {
    title: '客户PO',
    dataIndex: 'po',
    width: 220
  },
  {
    title: '客方货号',
    dataIndex: 'goodsNumber',
    width: 220
  },
  {
    title: '盒式',
    dataIndex: 'goodsType',
  },
  {
    title: '纸质',
    dataIndex: 'quality',
  },
  {
    title: '规格',
    dataIndex: 'size',
    width: 150
  },
  {
    title: '数量',
    dataIndex: 'quantity',
  },
  {
    title: '单价',
    dataIndex: 'price',
  },
  {
    title: '金额',
    dataIndex: 'amount',
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: 250
  },
];

export {
  orderSearchColumns,
  clientSearchColumns,
  orderAppendColumns,
  deliverySearchColumns,
  deliveryAppendColumns,
  deliveryCheckColumns,
  summaryColumns,
  orderSearchColumnsParent
}